unit UClienteControle;

interface

uses UBaseModel, UCliente;

type

  TClienteUniControle = class(TInterfacedObject, IControle)
    private
      FValue: Extended;
      procedure SetValue(const Value: Extended);
      property Value: Extended read FValue write SetValue;
    protected
      constructor Create;

    public
      // Obrigatorio - IControle
      procedure Salvar;
      function Encontrar(sID: String): TBaseObject;
      function Novo: TBaseObject;
  end;

  TClienteControle = class
    private
      function GetUniqueValue:Extended;
      procedure SetUniqueValue(const Value: Extended);

    protected

    public
      property UniqueValue: Extended read GetUniqueValue write SetUniqueValue;
  end;


implementation

uses SysUtils;

{ TClienteControle }

constructor TClienteControle.Create;
begin
  raise Exception.Create('Para Obter um ClienteControle Invoque o Metodo GetIntance');
end;

destructor TClienteControle.Destroy;
begin
  inherited;
end;

function TClienteControle.Encontrar(sID: String): TBaseObject;
begin
  //Result := FModelo.Buscar(sID);
end;

class function TClienteControle.GetInstancia: TClienteControle;
begin
  Result := M
end;

function TClienteControle.Novo: TBaseObject;
begin

end;

constructor TClienteControle.PrivadoCreate;
begin
  inherited Create;
end;

procedure TClienteControle.Salvar;
begin

end;

{ TMyUniqueClass }

constructor TMyUniqueClass.Create;
begin
  inherited;
end;

procedure TMyUniqueClass.SetValue(const Value: Extended);
begin
  MyUniqueClass := Value;
end;

initialization
  MyUniqueClass := TMyUniqueClass.Create;

finalization
  MyUniqueClass.Free;

// http://www.luizsistemas.com.br/2012/09/design-pattern-singleton/
// http://wcabralti.blogspot.com.br/2012/11/usando-padrao-de-projeto-singleton-na.html
// 


end.
